# Maintainer: Muflone http://www.muflone.com/contacts/english/

pkgname=perl-gtk3-simplelist
_perl_module=Gtk3-SimpleList
pkgver=0.21
pkgrel=1
pkgdesc="Perl interface to the Gtk3's complex MVC list widget"
arch=('any')
url="https://metacpan.org/release/${_perl_module}"
license=('LGPL')
depends=('perl-gtk3')
source=("https://cpan.metacpan.org/authors/id/T/TV/TVIGNAUD/${_perl_module}-${pkgver}.tar.gz")
sha512sums=('45f13add5465d586a6888c426c252cf886644dc95d981d697dc78d01fe66e7820c8f866206583c103fa35b63c349ba46c7da58a447e77a8c778c54b57dddc973')
options=('!emptydirs')

build() {
  cd "${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  perl Makefile.PL
  make
}

check() {
  cd "${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd "${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  make pure_install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
  # Delete unuseful files
  find "${pkgdir}" -name '.packlist' -delete
}
